package cn.kfu.service.impl;

import cn.kfu.dao.UserLoginLogDao;
import cn.kfu.model.UserLoginLog;
import cn.kfu.service.UserLoginLogService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.ArrayList;
import java.util.List;

@Service
public class UserLoginLogServiceImpl implements UserLoginLogService {
    @Autowired
    private UserLoginLogDao userLoginLogDao;

    public List<UserLoginLog> findAll() {
        List<UserLoginLog> userLoginLogs = new ArrayList<>();
        userLoginLogDao.findAll().forEach(userLoginLogs::add);
        return userLoginLogs;
    }

    @Override
    public void save(UserLoginLog userLoginLog) {
        userLoginLogDao.save(userLoginLog);
    }
}
